/*******************************************************************************
** www.IfcGears.com                                                           **
** Copyright (C) 2010 - Bauhaus University Weimar, www.uni-weimar.de          **
** Written: 2010-10-02, Fabian Gerold, www.fabiangerold.de                    **
*******************************************************************************/

#pragma once

#include <QtGui>

class IfcGears;

class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	MainWindow( IfcGears* class_generator, QWidget *parent = 0 );
	~MainWindow();
	void updateRecentFilesMenu();

signals:
	void signalSaveAllChanges();

	public slots:
		void slotTxtOut( QString txt );
		void slotTxtOutWarning( QString txt );
		void slotProgressValue( int );
		int slotAddSchemaFile( QString path );
		void slotFileWidgetLoaded();
		void slotLoadSchemaClicked();
		void slotIncludeComments(int);
		void slotLoadRecentFileClicked();

protected:
	void closeEvent( QCloseEvent* event );
	void keyPressEvent( QKeyEvent* event );

private:
	IfcGears*		m_class_generator;

	QPushButton*	m_btn_parse_schema;
	QTabWidget*		m_files_tab;
	QLineEdit*		m_le_path_out;
	//QLineEdit*		m_le_subfolder_ifc_classes_out;
	QTextEdit*		m_txt_out;
	QProgressBar*	m_progress_bar;

	QTableWidget*	m_table_recent_files;
	std::map<int, int> m_map_recent_tabindex_tablerow;
	QStringList		m_recent_files;

	QTableWidget*	m_table_schema_files;
	//std::map<int, int> m_map_tabindex_tablerow;
	std::map<QPushButton*, int> m_map_btnload_tablerow;

	// options
	//QLineEdit*		m_le_namespace;

	private slots:
		void slotAddOtherSchemaFileClicked();
		void slotParseSchemaClicked();
		void slotTabCloseRequested( int index );
};
